-
Notifications
You must be signed in to change notification settings - Fork 15
asset marketplace #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/xion-asset
Are you sure you want to change the base?
Conversation
f44c450
to
4090295
Compare
let id = generate_id(vec![&collection.as_bytes(), &token_id.as_bytes()]); | ||
let listing = Listing { | ||
id: id.clone(), | ||
seller: info.sender.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the marketplace will act as the listing creator, when a sale is completed the funds are sent to the Marketplace contract and because the marketplace has no withdrawal mechanism for sellers to retrieve payments, the funds get stuck there permanently.
- Buyer purchases NFT
- Marketplace forwards payment to asset contract
- Asset contract sends payment to "seller" (which is marketplace address)
- Marketplace contract receives funds
- No recording of "owe seller X amount"
- No way for seller to withdraw
- Funds stuck in marketplace forever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emperorjm I made @Peartes aware that when listing the seller should be the owner and not the marketplace because is acting as the operator
valid_payment(&info, price.clone(), listing.price.denom)?; | ||
|
||
let buy_msg = asset_buy_msg(info.sender.clone(), listing.token_id.clone()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove listing from marketplace storage after successful purchase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contracts/marketplace/src/helpers.rs
Outdated
token_id: token_id.clone(), | ||
price: price.clone(), | ||
reservation: None, | ||
marketplace_fee_bps: None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How should marketplace fees be handled? Also, is there a means of updating the fees?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should come from the config, I've added it now and also an UpdateConfig message that only the manager can execute.
_info: MessageInfo, | ||
_id: String, | ||
) -> Result<Response, ContractError> { | ||
// TODO: Implement approve sale functionality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this feature required?
_info: MessageInfo, | ||
_id: String, | ||
) -> Result<Response, ContractError> { | ||
// TODO: Implement reject sale functionality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this feature required?
No description provided.